package view.paciente;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.EventQueue;
import java.awt.FlowLayout;
import java.awt.Font;

import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;
import javax.swing.border.EmptyBorder;


public class TelaVisualizarPaciente extends JDialog {

	private static final long serialVersionUID = 1L;
	
	private JPanel panelNorte;
	private final JPanel panelCentro = new JPanel();
	private JPanel panelSul;
	
	private JLabel lblCadastroPaciente;
	private JLabel lblDadosPessoais;
	private JLabel lblNomeCompleto; 
	private JLabel lblDataNascimento;
	private JLabel lblSexo;
	private JLabel lblCpf;
	private JLabel lblRg;
	private JLabel lblEstadoCivil;
	private JLabel lblCor;
	private JLabel lblEscolaridade;
	private JLabel lblProfissao;
	private JLabel lblFiliacao;
	private JLabel lblNomeMae;
	private JLabel lblNomePai;
	private JLabel lblEndereco;
	private JLabel lblLogradouro;
	private JLabel lblNumero;
	private JLabel lblComplemento;
	private JLabel lblBairro;
	private JLabel lblCidade;
	private JLabel lblEstado;
	private JLabel lblCep;
	private JLabel lblContato;
	private JLabel lblTelefone;
	private JLabel lblCelular;
	private JLabel lblOrgaoEmissor;
	private JLabel lblEmail;
	
	private JButton btnSalvar;
	private JButton btnCancelar;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {

		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
						if ("Nimbus".equals(info.getName())) {
							UIManager.setLookAndFeel(info.getClassName());
							break;
						}else{
							UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
						}
					}
					TelaVisualizarPaciente window = new TelaVisualizarPaciente();
					window.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});		
	}

	/**
	 * Create the dialog.
	 */
	public TelaVisualizarPaciente() {
		setBounds(100, 100, 600, 640);
		getContentPane().setLayout(new BorderLayout());
		panelCentro.setBackground(Color.WHITE);
		panelCentro.setBorder(new EmptyBorder(5, 0, 5, 5));
		getContentPane().add(panelCentro, BorderLayout.CENTER);
		
		lblDadosPessoais = new JLabel("Dados Pessoais");
		lblDadosPessoais.setBorder(new EmptyBorder(0, 0, 0, 5));
		lblDadosPessoais.setHorizontalAlignment(SwingConstants.RIGHT);
		lblDadosPessoais.setOpaque(true);
		lblDadosPessoais.setBackground(Color.LIGHT_GRAY);
		lblDadosPessoais.setFont(new Font("Tahoma", Font.BOLD, 12));
		
		lblNomeCompleto = new JLabel("Nome Completo:");
		
		lblDataNascimento = new JLabel("Data Nascimento:");
		
		lblSexo = new JLabel("Sexo:");
		
		lblCpf = new JLabel("CPF:");
		
		lblRg = new JLabel("RG:");
		
		lblEstadoCivil = new JLabel("Estado Civil:");
		
		lblFiliacao = new JLabel("Filia\u00E7\u00E3o");
		lblFiliacao.setOpaque(true);
		lblFiliacao.setHorizontalAlignment(SwingConstants.RIGHT);
		lblFiliacao.setFont(new Font("Tahoma", Font.BOLD, 12));
		lblFiliacao.setBorder(new EmptyBorder(0, 0, 0, 5));
		lblFiliacao.setBackground(Color.LIGHT_GRAY);
		
		lblNomeMae = new JLabel("Nome da M\u00E3e:");
		
		lblNomePai = new JLabel("Nome do Pai:");
		
		lblCor = new JLabel("Cor:");
		
		lblProfissao = new JLabel("Profiss\u00E3o:");
		
		lblEscolaridade = new JLabel("Escolaridade:");
		
		lblEndereco = new JLabel("Endere\u00E7o");
		lblEndereco.setOpaque(true);
		lblEndereco.setHorizontalAlignment(SwingConstants.RIGHT);
		lblEndereco.setFont(new Font("Tahoma", Font.BOLD, 12));
		lblEndereco.setBorder(new EmptyBorder(0, 0, 0, 5));
		lblEndereco.setBackground(Color.LIGHT_GRAY);
		
		lblLogradouro = new JLabel("Logradouro (Rua, Avenida, Travessa, etc.):");
		
		lblNumero = new JLabel("N\u00FAmero:");
		
		lblComplemento = new JLabel("Complemento:");
		
		lblBairro = new JLabel("Bairro:");
		
		lblCidade = new JLabel("Cidade:");
		
		lblEstado = new JLabel("Estado:");
		
		lblCep = new JLabel("CEP:");
		
		lblContato = new JLabel("Contato");
		lblContato.setOpaque(true);
		lblContato.setHorizontalAlignment(SwingConstants.RIGHT);
		lblContato.setFont(new Font("Tahoma", Font.BOLD, 12));
		lblContato.setBorder(new EmptyBorder(0, 0, 0, 5));
		lblContato.setBackground(Color.LIGHT_GRAY);
		
		lblTelefone = new JLabel("Telefone:");
		
		lblCelular = new JLabel("Celular:");
		
		lblOrgaoEmissor = new JLabel("Orgao Emissor / UF:");
		
		lblEmail = new JLabel("Email:");
		GroupLayout gl_panelCentro = new GroupLayout(panelCentro);
		gl_panelCentro.setHorizontalGroup(
			gl_panelCentro.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_panelCentro.createSequentialGroup()
					.addGroup(gl_panelCentro.createParallelGroup(Alignment.LEADING, false)
						.addGroup(gl_panelCentro.createSequentialGroup()
							.addContainerGap()
							.addGroup(gl_panelCentro.createParallelGroup(Alignment.LEADING, false)
								.addGroup(gl_panelCentro.createSequentialGroup()
									.addComponent(lblEscolaridade)
									.addPreferredGap(ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
									.addComponent(lblProfissao)
									.addGap(380))
								.addGroup(gl_panelCentro.createSequentialGroup()
									.addGroup(gl_panelCentro.createParallelGroup(Alignment.LEADING, false)
										.addGroup(gl_panelCentro.createSequentialGroup()
											.addComponent(lblNomeCompleto)
											.addGap(219)
											.addComponent(lblDataNascimento)
											.addGap(36)
											.addComponent(lblSexo))
										.addGroup(gl_panelCentro.createSequentialGroup()
											.addComponent(lblCpf)
											.addGap(92)
											.addComponent(lblRg)
											.addGap(99)
											.addComponent(lblOrgaoEmissor)
											.addPreferredGap(ComponentPlacement.UNRELATED)
											.addComponent(lblEstadoCivil)))
									.addPreferredGap(ComponentPlacement.UNRELATED)
									.addComponent(lblCor)
									.addGap(61))))
						.addComponent(lblFiliacao, GroupLayout.PREFERRED_SIZE, 127, GroupLayout.PREFERRED_SIZE)
						.addGroup(gl_panelCentro.createSequentialGroup()
							.addContainerGap()
							.addComponent(lblNomeMae, GroupLayout.PREFERRED_SIZE, 94, GroupLayout.PREFERRED_SIZE)
							.addGap(198)
							.addComponent(lblNomePai, GroupLayout.PREFERRED_SIZE, 94, GroupLayout.PREFERRED_SIZE))
						.addComponent(lblEndereco, GroupLayout.PREFERRED_SIZE, 127, GroupLayout.PREFERRED_SIZE)
						.addGroup(gl_panelCentro.createSequentialGroup()
							.addContainerGap()
							.addGroup(gl_panelCentro.createParallelGroup(Alignment.LEADING, false)
								.addGroup(gl_panelCentro.createSequentialGroup()
									.addComponent(lblLogradouro)
									.addGap(80)
									.addComponent(lblNumero)
									.addGap(32)
									.addComponent(lblComplemento))
								.addGroup(gl_panelCentro.createSequentialGroup()
									.addComponent(lblBairro)
									.addGap(139)
									.addComponent(lblCidade)
									.addGap(132)
									.addComponent(lblEstado)
									.addGap(28)
									.addComponent(lblCep))))
						.addComponent(lblContato, GroupLayout.PREFERRED_SIZE, 127, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblDadosPessoais, GroupLayout.PREFERRED_SIZE, 188, GroupLayout.PREFERRED_SIZE)
						.addGroup(gl_panelCentro.createSequentialGroup()
							.addContainerGap()
							.addComponent(lblTelefone)
							.addGap(89)
							.addComponent(lblCelular)
							.addGap(97)
							.addComponent(lblEmail)))
					.addGap(127))
		);
		gl_panelCentro.setVerticalGroup(
			gl_panelCentro.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_panelCentro.createSequentialGroup()
					.addContainerGap()
					.addComponent(lblDadosPessoais)
					.addPreferredGap(ComponentPlacement.UNRELATED)
					.addGroup(gl_panelCentro.createParallelGroup(Alignment.LEADING)
						.addGroup(gl_panelCentro.createParallelGroup(Alignment.BASELINE)
							.addComponent(lblSexo)
							.addComponent(lblDataNascimento))
						.addGroup(gl_panelCentro.createSequentialGroup()
							.addComponent(lblNomeCompleto)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addGroup(gl_panelCentro.createParallelGroup(Alignment.LEADING)
								.addComponent(lblCpf)
								.addComponent(lblRg)
								.addGroup(gl_panelCentro.createParallelGroup(Alignment.BASELINE)
									.addComponent(lblOrgaoEmissor)
									.addComponent(lblEstadoCivil)
									.addComponent(lblCor)))))
					.addGap(60)
					.addGroup(gl_panelCentro.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblEscolaridade)
						.addComponent(lblProfissao))
					.addGap(46)
					.addComponent(lblFiliacao, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE)
					.addPreferredGap(ComponentPlacement.UNRELATED)
					.addGroup(gl_panelCentro.createParallelGroup(Alignment.TRAILING)
						.addGroup(gl_panelCentro.createSequentialGroup()
							.addComponent(lblNomeMae)
							.addGap(34))
						.addGroup(gl_panelCentro.createSequentialGroup()
							.addComponent(lblNomePai)
							.addGap(34)))
					.addPreferredGap(ComponentPlacement.UNRELATED)
					.addComponent(lblEndereco, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE)
					.addPreferredGap(ComponentPlacement.UNRELATED)
					.addGroup(gl_panelCentro.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblLogradouro)
						.addComponent(lblNumero)
						.addComponent(lblComplemento))
					.addGap(40)
					.addGroup(gl_panelCentro.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblBairro)
						.addComponent(lblCidade)
						.addComponent(lblEstado)
						.addComponent(lblCep))
					.addGap(46)
					.addComponent(lblContato, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE)
					.addPreferredGap(ComponentPlacement.RELATED, 23, Short.MAX_VALUE)
					.addGroup(gl_panelCentro.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblTelefone)
						.addComponent(lblCelular)
						.addComponent(lblEmail))
					.addGap(40))
		);
		gl_panelCentro.linkSize(SwingConstants.HORIZONTAL, new Component[] {lblDadosPessoais, lblFiliacao, lblEndereco, lblContato});
		panelCentro.setLayout(gl_panelCentro);
		{
			panelSul = new JPanel();
			panelSul.setLayout(new FlowLayout(FlowLayout.RIGHT));
			getContentPane().add(panelSul, BorderLayout.SOUTH);
			{
				btnSalvar = new JButton("Salvar");
				btnSalvar.setActionCommand("OK");
				panelSul.add(btnSalvar);
				getRootPane().setDefaultButton(btnSalvar);
			}
			{
				btnCancelar = new JButton("Cancelar");
				btnCancelar.setActionCommand("Cancel");
				panelSul.add(btnCancelar);
			}
		}
		{
			panelNorte = new JPanel();
			panelNorte.setForeground(Color.WHITE);
			panelNorte.setBackground(Color.BLUE);
			getContentPane().add(panelNorte, BorderLayout.NORTH);
			
			lblCadastroPaciente = new JLabel("Paciente");
			lblCadastroPaciente.setForeground(Color.WHITE);
			lblCadastroPaciente.setFont(new Font("Tahoma", Font.BOLD, 18));
			panelNorte.add(lblCadastroPaciente);
		}
	}
}
